import { mapGetters, mapMutations } from 'vuex'
export default {
  name: 'back-mixin',
  computed: {
    ...mapGetters(['footprint'])
  },
  methods: {
    /**
     *
     * @param {*} name 当前页面名字
     * @param {*} path 要跳转的路由
     */
    goPath (name, path) {
      const footprint = this.footprint.filter(v => !v.link.includes(name))
      this.set_footprint(footprint)
      this.$router.push({ path })
    },
    ...mapMutations({
      'set_footprint': 'SET_FOOTPRINT'
    })
  }
}
